package com.zhongfl.crm.enums.boss;

import lombok.Getter;

/**
 * @author 木叶丸
 * @date 2018/8/19 21:33
 */
@Getter
public enum ChannelNature {

    /**
     * 渠道性质
     */
    FROM_ONLINE("网上获客", "3100431"),
    FROM_PHONE("电话销售", "3100432"),
    NEW_NET("新网渠道", "3100433"),
    SAME_TRADE("同行渠道", "3100434"),
    OTHER("", "");

    private String natureName;

    private String natureCode;

    ChannelNature(String natureName, String natureCode) {
        this.natureName = natureName;
        this.natureCode = natureCode;
    }

    public static ChannelNature getEnumByNatureName(String natureName) {
        for (ChannelNature item : ChannelNature.values()) {
            if (item.getNatureName().equals(natureName)) {
                return item;
            }
        }
        return OTHER;
    }

    public static ChannelNature getEnumByNatureCode(String natureCode) {
        for (ChannelNature item : ChannelNature.values()) {
            if (item.getNatureCode().equals(natureCode)) {
                return item;
            }
        }
        return OTHER;
    }

}
